package r5.powtorka3;

import java.text.DateFormat;

public class Manager extends Employee {

	private double bonus;

	public Manager(String name, double salary, int year, int month, int day) {
		super(name, salary, year, month, day);
		this.bonus = 0;
	}

	public double getBonus() {
		return bonus;
	}

	public void setBonus(double bonus) {
		this.bonus = bonus;
	}

	@Override
	public String toString() {
		return this.getClass().getSimpleName() + " " + super.getName()
				+ ", salary: " + this.getSalary() + ", hired: "
				+ DateFormat.getDateInstance().format(super.getHireDate())
				+ " [bonus: " + this.bonus + "]";
	}

	@Override
	public double getSalary() {
		return super.getSalary() + this.bonus;
	}

}
